/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ronsicecream.pos.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author user
 */
@Entity
@Table(name = "pos_master_unit_type")
@XmlRootElement
//@NamedQueries({
//    @NamedQuery(name = "PosMasterUnitType.findAll", query = "SELECT p FROM PosMasterUnitType p"),
//    @NamedQuery(name = "PosMasterUnitType.findBySync", query = "SELECT p FROM PosMasterUnitType p WHERE p.sync = :sync"),
//    @NamedQuery(name = "PosMasterUnitType.findByUnitTypeId", query = "SELECT p FROM PosMasterUnitType p WHERE p.unitTypeId = :unitTypeId"),
//    @NamedQuery(name = "PosMasterUnitType.findByUnitTypeName", query = "SELECT p FROM PosMasterUnitType p WHERE p.unitTypeName = :unitTypeName")})
public class PosMasterUnitType implements Serializable {
    private static final long serialVersionUID = 1L;
    @Column(name = "sync")
    private String sync;
    @Id
    @Basic(optional = false)
    @Column(name = "unit_type_id")
    private Integer unitTypeId;
    @Column(name = "unit_type_name")
    private String unitTypeName;
   
    public PosMasterUnitType() {
    }

    public PosMasterUnitType(Integer unitTypeId) {
        this.unitTypeId = unitTypeId;
    }

    public String getSync() {
        return sync;
    }

    public void setSync(String sync) {
        this.sync = sync;
    }

    public Integer getUnitTypeId() {
        return unitTypeId;
    }

    public void setUnitTypeId(Integer unitTypeId) {
        this.unitTypeId = unitTypeId;
    }

    public String getUnitTypeName() {
        return unitTypeName;
    }

    public void setUnitTypeName(String unitTypeName) {
        this.unitTypeName = unitTypeName;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (unitTypeId != null ? unitTypeId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PosMasterUnitType)) {
            return false;
        }
        PosMasterUnitType other = (PosMasterUnitType) object;
        if ((this.unitTypeId == null && other.unitTypeId != null) || (this.unitTypeId != null && !this.unitTypeId.equals(other.unitTypeId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return unitTypeName;
//        return "com.ronsicecream.pos.entities.PosMasterUnitType[ unitTypeId=" + unitTypeId + " ]";
    }
    
}
